#ifndef _GEOMETRY_RAY_H_
#define _GEOMETRY_RAY_H_

#include "../Basis/Vector3.h"

class Ray
{
public:
	Ray();
	Ray(const Vector3& a, const Vector3& b);
	Ray(const Ray & r);
	Vector3 origin() const;
	Vector3 direction() const;
	Vector3 pointAtParameter(float t) const;
	//	r(t) = o + t * d
	Vector3 operator()(float t) const;

	//	data[0]: origin
	//	data[1]: direction
	Vector3 data[2];
};

inline ostream &operator<<(ostream &os, const Ray &r)
{
	os << "origin: " << r.origin() << "direction: " << r.direction();
	return os;
}


#endif